package org.web.ssm.dao;

import org.web.ssm.model.Product;
import org.web.ssm.model.queryVo.BaseQuery;

import java.util.List;

/**
 * Created by hubin on 2016/6/15.
 */

public interface ProductMapper {

    /**
     * 添加产品
     *
     * @param product
     * @throws Exception
     */
    void addProduct(Product product) throws Exception;

    /**
     * 跟新产品
     *
     * @param product
     * @throws Exception
     */
    void updateProduct(Product product) throws Exception;

    /**
     * 删除产品
     *
     * @param productId
     * @throws Exception
     */
    void delProduct(int productId) throws Exception;

    /**
     * 获取产品列表
     *
     * @param query
     * @throws Exception
     */
    List<Product> getProductList(BaseQuery<Product> query) throws Exception;

    /**
     * 获取产品总数
     *
     * @return
     * @throws Exception
     */
    int getCount(BaseQuery<Product> productQuery) throws Exception;

    /**
     * 设置上下加
     *
     * @param id
     * @throws Exception
     */
    void tookProduct(int id) throws Exception;

    /**
     * 查询单个产品
     *
     * @param id
     * @return
     */
    Product selectByPrimarykey(String id);
}
